package com.smomo.blog.Text;

import io.swagger.v3.oas.models.links.Link;

import java.util.ArrayList;
import java.util.List;

public class selfInvocation {

    int age;
    int name;

    List<Integer> res=new ArrayList<>();

    public selfInvocation(int age, int name, List<Integer> res) {
        this.age = age;
        this.name = name;
        this.res = res;
    }

    public selfInvocation() {
    }

    public selfInvocation putall(int num)
    {
        this.res.add(num);
        return this;
    }

    public static selfInvocation aa()
    {
        return new selfInvocation();
    }

    public static void main(String[] args) {
        selfInvocation putall = selfInvocation.aa().putall(1).putall(2).putall(3);
        System.out.println(putall.res);
        System.out.println(selfInvocation.aa().res);
    }




}
